Optimal. Leaf size=57 \[ a^2 x+\frac {2 a^2 \sin (c+d x)}{d}+\frac {a^2 \cos (c+d x) \sin (c+d x)}{d}-\frac {a^2 \sin ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 69, normalized size of antiderivative = 1.21, number of steps
used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2830, 2723}
\begin {gather*} \frac {4 a^2 \sin (c+d x)}{3 d}+\frac {a^2 \sin (c+d x) \cos (c+d x)}{3 d}+a^2 x+\frac {\sin (c+d x) (a \cos (c+d x)+a)^2}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2723
Rule 2830
Rubi steps
\begin {align*} \int \cos (c+d x) (a+a \cos (c+d x))^2 \, dx &=\frac {(a+a \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac {2}{3} \int (a+a \cos (c+d x))^2 \, dx\\ &=a^2 x+\frac {4 a^2 \sin (c+d x)}{3 d}+\frac {a^2 \cos (c+d x) \sin (c+d x)}{3 d}+\frac {(a+a \cos (c+d x))^2 \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 41, normalized size = 0.72 \begin {gather*} \frac {a^2 (12 d x+21 \sin (c+d x)+6 \sin (2 (c+d x))+\sin (3 (c+d x)))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 64, normalized size = 1.12
method | result | size |
risch | \(a^{2} x +\frac {7 a^{2} \sin \left (d x +c \right )}{4 d}+\frac {a^{2} \sin \left (3 d x +3 c \right )}{12 d}+\frac {a^{2} \sin \left (2 d x +2 c \right )}{2 d}\) | \(55\) |
derivativedivides | \(\frac {\frac {a^{2} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}+2 a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} \sin \left (d x +c \right )}{d}\) | \(64\) |
default | \(\frac {\frac {a^{2} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}+2 a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} \sin \left (d x +c \right )}{d}\) | \(64\) |
norman | \(\frac {a^{2} x +a^{2} x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {6 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {16 a^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 a^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+3 a^{2} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 a^{2} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(128\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 61, normalized size = 1.07 \begin {gather*} -\frac {2 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{2} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} - 6 \, a^{2} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 49, normalized size = 0.86 \begin {gather*} \frac {3 \, a^{2} d x + {\left (a^{2} \cos \left (d x + c\right )^{2} + 3 \, a^{2} \cos \left (d x + c\right ) + 5 \, a^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 107 vs.
\(2 (51) = 102\).
time = 0.12, size = 107, normalized size = 1.88 \begin {gather*} \begin {cases} a^{2} x \sin ^{2}{\left (c + d x \right )} + a^{2} x \cos ^{2}{\left (c + d x \right )} + \frac {2 a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {a^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {a^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} + \frac {a^{2} \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + a\right )^{2} \cos {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 54, normalized size = 0.95 \begin {gather*} a^{2} x + \frac {a^{2} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {a^{2} \sin \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac {7 \, a^{2} \sin \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.38, size = 61, normalized size = 1.07 \begin {gather*} a^2\,x+\frac {5\,a^2\,\sin \left (c+d\,x\right )}{3\,d}+\frac {a^2\,{\cos \left (c+d\,x\right )}^2\,\sin \left (c+d\,x\right )}{3\,d}+\frac {a^2\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________